package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heima.pojo.dto.VendingMachineSearchDto;
import com.heima.pojo.entity.VendingMachine;
import com.heima.pojo.vo.VendingMachineVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface VendingMachineMapper extends BaseMapper<VendingMachine> {
    @Select("select * from tb_vending_machine where node_id=#{nodeId}")
    List<VendingMachine> selectByNodeId(String nodeId);

    IPage<VendingMachineVo> selectPageVo(IPage<VendingMachineVo> page, VendingMachineSearchDto dto);

    @Select("select inner_code from tb_vending_machine ORDER BY id DESC LIMIT 1;")
    String findNewVMInnerCode();

}
